import http from '@/utils/fetch'

// 筛选获取所有订单状态
export function getOrderStatus() {
  return http.post('/Supplier/Finance/getOrderStatus')
}
// 财务订单列表
export function financeOrderList(params) {
  return http.post('/Supplier/Finance/financeOrderList', params)
}
// 账单财务列表
export function financeLeaseList(params) {
  return http.post('/Supplier/Finance/financeLeaseList', params)
}
// 财务逾期列表
export function financeOverdueList(params) {
  return http.post('/Supplier/Finance/financeOverdueList', params)
}
// 获取记录流水
export function getLeaseFlow(params) {
  return http.post('/Supplier/Finance/getLeaseFlow', params)
}
// 财务订单导出
export function orderListExport(params) {
  return http.export(
    '/Supplier/Finance/orderListExport',
    params,
    '订单财务列表'
  )
}
// 财务租期列表导出
export function leaseListExport(params) {
  return http.export(
    '/Supplier/Finance/leaseListExport',
    params,
    '账单财务列表'
  )
}
// 财务逾期列表导出
export function overdueListExport(params) {
  return http.export('/Supplier/Finance/overdueListExport', params, '逾期列表')
}
// 财务对账流水导出
export function reconciliationExport(params) {
  return http.export(
    '/Supplier/Finance/reconciliationExport',
    params,
    '对账流水'
  )
}
// 财务对账流水
export function reconciliationFlow(params) {
  return http.post('/Supplier/Finance/reconciliationFlow', params)
}
// 获取手续费率和手续费详情
export function getFeeDetails(params) {
  return http.post('/Supplier/Finance/getFeeDetails', params)
}
// 提现记录
export function withdrawalList(params) {
  return http.post('/Supplier/Withdrawal/withdrawalList', params)
}
// 手动代扣
export function manualWithholding(params) {
  return http.post('/Supplier/Finance/manualWithholding', params, true)
}
// 逾期列表-客服备注记录
export function getOrderRemark(params) {
  return http.post('/Supplier/Finance/getOrderRemark', params)
}
// 逾期列表-短信发送记录
export function getOverdueSmsLog(leaseId) {
  return http.post('/Supplier/Finance/getOverdueSmsLog', { leaseId })
}
// 逾期列表-逾期短信批量发送
export function sendOverdueSms(leaseId) {
  return http.post('/Supplier/Finance/sendOverdueSms', { leaseId })
}
// 添加客服备注
export function setOrderRemark(params) {
  return http.post('/Supplier/Finance/setOrderRemark', params, true)
}
// 查看扣款记录
export function leaseWithholdLog(params) {
  return http.post('/Supplier/Finance/leaseWithholdLog', params)
}

// 花呗财务账单列表
export function financeHuaBeiList(params) {
  return http.post('/Supplier/Finance/financeHuaBeiList', params)
}
// 花呗财务账单列表-导出
export function huaBeiListExport(params) {
  return http.export(
    '/Supplier/Finance/huaBeiListExport',
    params,
    '花呗财务账单列表'
  )
}
// 设备分期列表
export function financeEquipmentList(params) {
  return http.post('/Supplier/Finance/financeEquipmentList', params)
}
// 设备分期列表-导出
export function equipmentListExport(params) {
  return http.export(
    '/Supplier/Finance/equipmentListExport',
    params,
    '设备分期列表'
  )
}
// 回款列表
export function financeCollectionList(params) {
  return http.post('/Supplier/Finance/financeCollectionList', params)
}
// 回款列表-导出
export function collectionListExport(params) {
  return http.export(
    '/Supplier/Finance/collectionListExport',
    params,
    '回款列表'
  )
}
// 功能设置
export function functionSet(is_automatic_report_bill) {
  return http.get(
    '/Supplier/ReportBill/functionSet',
    {
      is_automatic_report_bill
    },
    true
  )
}
// 获取供应商信息
export function getShopUserInfo() {
  return http.get('/Supplier/ReportBill/getShopUserInfo')
}
// 自动代扣开关操作
export function withholdSwitch(params) {
  return http.post('/Supplier/Finance/withholdSwitch', params, true)
}

// 获取修改账单为线下支付订单信息
export function getOfflinePayData(oId, lId) {
  return http.get('/Supplier/Finance/getOfflinePayData', { order_id: oId, lease_id: lId })
}
// 线下支付发送验证码
export function offlinePaySendCode(oId, lId) {
  return http.post('/Supplier/Finance/offlinePaySendCode', { order_id: oId, lease_id: lId }, true)
}
// 修改账单为线下支付
export function setOfflinePay(params) {
  return http.post('/Supplier/Finance/setOfflinePay', params, true)
}
// 获取订单操作记录
export function getOrderLog(params) {
  return http.get('/Supplier/Finance/getOrderLog', params)
}

// 获取订单操作记录
export function manualWithholding_XZ(params) {
  return http.post('/Supplier/Finance/manualWithholding_XZ', params)
}

// 手动代扣_余款
export function manualWithholding_1(params) {
  return http.post('/Supplier/Finance/manualWithholding1', params, true)
}
// 获取还款状态次数
export function getRepaymentTimes(params) {
  return http.post('/Supplier/Finance/getRepaymentTimes', params)
}
// 账单日列表
export function accountantDayList(params) {
  return http.post('/Supplier/Finance/accountantDayList', params)
}

/**
 * 移交催收
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export function handoverCollection(params) {
  return http.post('/Supplier/Finance/handoverCollection', params)
}